package com.chinatsp.onlineapp.presenter;

import tsp.cn.http.BaseIDao;
import tsp.cn.http.HttpConfig;
import tsp.cn.http.interfac.INetResult;
import tsp.cn.http.tools.LogUtil;
import tsp.cn.http.tools.T;
import android.content.Context;

import com.chinatsp.onlineapp.base.Config;

/**
 * 获取在线新闻详细信息接口
 */

public class MewsMessageDao extends BaseIDao {

    private Context mContext;
    public MewsMessageDao(Context context, INetResult iNetResult) {
        super(context, iNetResult);
        this.mContext = context;
    }

    /**
     * 得到结果后，对结果处理逻辑
     *
     * @param result
     * @param requestCode
     */
    @Override
    public void onRequestSuccess(String result, int requestCode) {
        LogUtil.v("---开始处理---"+result);
        T.showShort(mContext, result);
    }

    /**
     * 新闻
     *
     * @param newsId 新闻唯一的ID
     */
    public void getNewsMessage(String newsId) {

        StringBuilder strBuilder = new StringBuilder();
        strBuilder.append(HttpConfig.appendString());
        strBuilder.append(Config.API_NEWS_MESSAGE);
        strBuilder.append(newsId);
        strBuilder.append("/");
        getRequest(strBuilder.toString(), Config.CODE_NEWS_MESSAGE);

    }
}
